/**
 * Created by gongxun on 17/2/14.
 */

var KwxWxHelperLayer = KwxBaseLayer.extend({
    Panel_center: null,
    ctor: function () {
        this._super();
        this.loadCocostudio("res/ccs/KwxWxHelperLayer.json");
        mo.gameHelper.fixIosText(this.ccsNode);
        this.Panel_center = mo.seekWidgetByName(this.ccsNode, "Panel_center");

        //关闭
        mo.seekWidgetByName(this.ccsNode, "Button_close").addTouchEventListener(function(sender, type){
            if (mo.gameHelper.getIsTouchEndMenuClose(type)) {
                this.closeThis();
            }
        }, this);

        //关闭
        mo.seekWidgetByName(this.ccsNode, "Panel_touch").addTouchEventListener(function(sender, type){
            if (mo.gameHelper.getIsTouchEndMenuClose(type)) {
                this.closeThis();
            }
        }, this);

        //复制wx号码
        mo.seekWidgetByName(this.ccsNode, "Panel_wxCopy").addTouchEventListener(function(sender, type){
            if (mo.gameHelper.getIsTouchEndMenuClose(type)) {
                mo.nativeHelper.copyString("han_811");
                mo.showRoomMsgShow("复制成功");
            }
        }, this);

        //复制wx号码2
        mo.seekWidgetByName(this.ccsNode, "Panel_wxCopy2").addTouchEventListener(function(sender, type){
            if (mo.gameHelper.getIsTouchEndMenuClose(type)) {
                mo.nativeHelper.copyString("LTK19880210");
                mo.showRoomMsgShow("复制成功");
            }
        }, this);

        //复制qq号码
        mo.seekWidgetByName(this.ccsNode, "Panel_qqCopy").addTouchEventListener(function(sender, type){
            if (mo.gameHelper.getIsTouchEndMenuClose(type)) {
                mo.nativeHelper.copyString("1913168621");
                mo.showRoomMsgShow("复制成功");
            }
        }, this);

        //打开没人玩怎么办
        mo.seekWidgetByName(this.ccsNode, "Button_noPlayer").addTouchEventListener(function(sender, type){
            if (mo.gameHelper.getIsTouchEndMenuClose(type)) {
                mo.eventHelper.dispatch("showNotFriendLayer");
                this.closeThis();
            }
        }, this);
    },

    onEnter : function(){
        this._super();
        mo.soundHelper.playDialogOpen();
        this.showAction(this.Panel_center);
    },

    closeThis : function(){
        this.closeAction(this.Panel_center)
    }
});